#ifndef PATHSTACK_H
#define PATHSTACK_H

#include <my_header.h>

//最长有几级路径
#define MAX_STACK_SIZE 100

typedef struct path_stack_s{
    int top;
    char *stack[MAX_STACK_SIZE];
}path_stack_t;

//初始化栈
int path_stack_init(path_stack_t* path_stack);
//使用一个已经存在的栈，初始化另一个栈
int path_stack_copy(path_stack_t* new_path_stack,path_stack_t* old_path_stack);
//销毁栈
int path_stack_destroy(path_stack_t* path_stack);
//出栈
int path_stack_pop(path_stack_t* path_stack);
//入栈,入栈current_path_name
int path_stack_push(path_stack_t* path_stack,const char* current_path_name);
//获取当前路径,结果放到result
int get_current_path_on_server(path_stack_t* path_stack,char* result);
//解析路径
int parse_path(path_stack_t* path_stack,const char* server_path, const char* full_path);
//cd命令
int cd_func(path_stack_t* path_stack, const char* server_path, const char *path, char* result);
//pwd命令
int pwd_func(path_stack_t* path_stack, char* result);
//输出栈里的所有内容
int print_stack(path_stack_t* path_stack);
//mkdir命令
int mkdir_func(path_stack_t* path_stack, const char* server_path, const char *dirname, char* result);
//rmdir命令
int rmdir_func(path_stack_t* path_stack, const char* server_path, const char *dirname, char* result);
//remove命令
int remove_func(path_stack_t* path_stack, const char* server_path, const char *file_path, char* result);
//ls命令
int ls_func(path_stack_t* path_stack, const char* server_path, const char *dir_path, char* result);
//ll命令
int ll_func(path_stack_t* path_stack, const char* server_path, const char *dir_path, char* result);
#endif

